﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Text.RegularExpressions;
using Character;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.UI;

// Token: 0x020001EC RID: 492
public class EditMode : MonoBehaviour
{
	// Token: 0x1700016E RID: 366
	// (get) Token: 0x06000D04 RID: 3332 RVA: 0x0004E248 File Offset: 0x0004C448
	public SEX Sex
	{
		get
		{
			return this.human.sex;
		}
	}

	// Token: 0x1700016F RID: 367
	// (get) Token: 0x06000D05 RID: 3333 RVA: 0x0004E258 File Offset: 0x0004C458
	private GameControl GameCtrl
	{
		get
		{
			if (this.gameCtrl == null)
			{
				this.gameCtrl = UnityEngine.Object.FindObjectOfType<GameControl>();
			}
			return this.gameCtrl;
		}
	}

	// Token: 0x06000D06 RID: 3334 RVA: 0x0004E27C File Offset: 0x0004C47C
	public void Setup(Human human, EditScene editScene)
	{
		this.human = human;
		this.coordinateCapture.SetHuman(human);
		this.SetupThumbs();
		EditEquipShow equipShow = (!(editScene != null)) ? null : editScene.equipShow;
		this.hair.Setup(human, equipShow);
		this.face.Setup(human, equipShow);
		this.body.Setup(human, equipShow);
		this.wear.Setup(human, equipShow);
		this.acce.Setup(human, equipShow);
		this.data.Setup(human, equipShow);
		IllusionCamera illusionCamera = UnityEngine.Object.FindObjectOfType<IllusionCamera>();
		this.backCardFrameCanvas.worldCamera = illusionCamera.GetComponent<Camera>();
		this.frontCardFrameCanvas.worldCamera = Transform_Utility.FindComponent<Camera>("UICamera");
		for (int i = 0; i < this.moveableUIs.Length; i++)
		{
			this.moveableUIs[i].transform.SetParent(this.moveableRoot, false);
		}
		this.colorCopyHelper.Setup(human);
	}

	// Token: 0x06000D07 RID: 3335 RVA: 0x0004E374 File Offset: 0x0004C574
	private void Update()
	{
		this.ui_canvas.enabled = (this.show && !this.GameCtrl.IsHideUI);
		EditMode.TAB tab = EditMode.TAB.NONE;
		for (int i = 0; i < this.toggles.Length; i++)
		{
			if (this.toggles[i].Value)
			{
				tab = (EditMode.TAB)i;
			}
		}
		if (this.nowTab != tab)
		{
			this.ChangeTab(tab);
		}
	}

	// Token: 0x06000D08 RID: 3336 RVA: 0x0004E3EC File Offset: 0x0004C5EC
	private void ChangeTab(EditMode.TAB tab)
	{
		this.nowTab = tab;
		for (int i = 0; i < this.toggles.Length; i++)
		{
			this.tabMains[i].SetActive(this.toggles[i].Value);
		}
		SystemSE.Play(SystemSE.SE.CHOICE);
	}

	// Token: 0x06000D09 RID: 3337 RVA: 0x0004E43C File Offset: 0x0004C63C
	private void SetupThumbs()
	{
		if (this.human.sex == SEX.FEMALE)
		{
			EditMode.SetupThumbs_HairBack(ref this.thumnbs_hair_set, CustomDataManager.Hair_b, "thumnbnail/thumbnail_hairset", string.Empty, this.smallRect.hair_set, true);
			EditMode.SetupThumbs_HairBack(ref this.thumnbs_hair_back, CustomDataManager.Hair_b, "thumnbnail/thumbnail_hairback", string.Empty, this.smallRect.hair_back, false);
			EditMode.SetupThumbs<HairData>(ref this.thumnbs_hair_side, CustomDataManager.Hair_s, "thumnbnail/thumbnail_hairside", string.Empty, this.smallRect.hair_side);
			EditMode.SetupThumbs<HairData>(ref this.thumnbs_hair_front, CustomDataManager.Hair_f, "thumnbnail/thumbnail_hairfront", string.Empty, this.smallRect.hair_front);
		}
		else
		{
			EditMode.SetupThumbs_HairBack(ref this.thumnbs_hair_set, CustomDataManager.Hair_Male, "thumnbnail/thumbnail_hairmale", string.Empty, this.smallRect.hair_male, true);
		}
		if (this.human.sex == SEX.FEMALE)
		{
			EditMode.SetupThumbs<WearData>(ref this.thumnbs_wear_tops, CustomDataManager.GetWearDictionary_Female(WEAR_TYPE.TOP), "thumnbnail/thumbnail_weartop", string.Empty, this.smallRect.wear_tops);
			EditMode.SetupThumbs<WearData>(ref this.thumnbs_wear_bottoms, CustomDataManager.GetWearDictionary_Female(WEAR_TYPE.BOTTOM), "thumnbnail/thumbnail_wearbot", string.Empty, this.smallRect.wear_bottoms);
			EditMode.SetupThumbs<WearData>(ref this.thumnbs_wear_bra, CustomDataManager.GetWearDictionary_Female(WEAR_TYPE.BRA), "thumnbnail/thumbnail_wearbra", string.Empty, this.smallRect.wear_bra);
			EditMode.SetupThumbs<WearData>(ref this.thumnbs_wear_shorts, CustomDataManager.GetWearDictionary_Female(WEAR_TYPE.SHORTS), "thumnbnail/thumbnail_wearshorts", string.Empty, this.smallRect.wear_shorts);
			EditMode.SetupThumbs<WearData>(ref this.thumnbs_wear_swimwear, CustomDataManager.GetWearDictionary_Female(WEAR_TYPE.SWIM), "thumnbnail/thumbnail_wearswim", "swimtop|swimbot", this.smallRect.wear_swimwear);
			EditMode.SetupThumbs<WearData>(ref this.thumnbs_wear_swimtops, CustomDataManager.GetWearDictionary_Female(WEAR_TYPE.SWIM_TOP), "thumnbnail/thumbnail_wearswimtop", string.Empty, this.smallRect.wear_swimtops);
			EditMode.SetupThumbs<WearData>(ref this.thumnbs_wear_swimbottoms, CustomDataManager.GetWearDictionary_Female(WEAR_TYPE.SWIM_BOTTOM), "thumnbnail/thumbnail_wearswimbot", string.Empty, this.smallRect.wear_swimbottoms);
			EditMode.SetupThumbs<WearData>(ref this.thumnbs_wear_glove, CustomDataManager.GetWearDictionary_Female(WEAR_TYPE.GLOVE), "thumnbnail/thumbnail_wearglove", string.Empty, this.smallRect.wear_glove);
			EditMode.SetupThumbs<WearData>(ref this.thumnbs_wear_panst, CustomDataManager.GetWearDictionary_Female(WEAR_TYPE.PANST), "thumnbnail/thumbnail_wearpanst", string.Empty, this.smallRect.wear_panst);
			EditMode.SetupThumbs<WearData>(ref this.thumnbs_wear_socks, CustomDataManager.GetWearDictionary_Female(WEAR_TYPE.SOCKS), "thumnbnail/thumbnail_wearsocks", string.Empty, this.smallRect.wear_socks);
			EditMode.SetupThumbs<WearData>(ref this.thumnbs_wear_shoes, CustomDataManager.GetWearDictionary_Female(WEAR_TYPE.SHOES), "thumnbnail/thumbnail_wearshoes", string.Empty, this.smallRect.wear_shoes);
		}
		else
		{
			EditMode.SetupThumbs<WearData>(ref this.thumnbs_wear_tops, CustomDataManager.GetWearDictionary_Male(WEAR_TYPE.TOP), "thumnbnail/thumbnail_wearmaletop", string.Empty, this.smallRect.wear_tops);
			EditMode.SetupThumbs<WearData>(ref this.thumnbs_wear_shoes, CustomDataManager.GetWearDictionary_Male(WEAR_TYPE.SHOES), "thumnbnail/thumbnail_wearmaleshoes", string.Empty, new Rect(0f, 0f, 256f, 256f));
		}
		if (this.human.sex == SEX.FEMALE)
		{
			EditMode.SetupThumbs_Head<HeadData>(ref this.thumnbs_faceType, CustomDataManager.Heads_Female, "thumnbnail/thumnbs_head", this.smallRect.faceType);
		}
		else
		{
			EditMode.SetupThumbs_Head<HeadData>(ref this.thumnbs_faceType, CustomDataManager.Heads_Male, "thumnbnail/thumnbs_head_m", this.smallRect.faceType);
		}
		if (this.human.sex == SEX.FEMALE)
		{
			EditMode.SetupThumbs<PrefabData>(ref this.thumnbs_faceSkin, CustomDataManager.FaceSkins_Female, "thumnbnail/thumnbs_faceskin", this.smallRect.faceSkin);
			EditMode.SetupThumbs<PrefabData>(ref this.thumnbs_bodySkin, CustomDataManager.BodySkins_Female, "thumnbnail/thumnbs_bodyskin", this.smallRect.bodySkin);
			EditMode.SetupThumbs_Tex<CombineTextureData>(ref this.thumnbs_sunburn, CustomDataManager.Sunburn, "thumnbnail/thumnbs_sunburn", this.smallRect.sunburn);
			EditMode.SetupThumbs_Tex<CombineTextureData>(ref this.thumnbs_bodyTattoo, CustomDataManager.BodyTattoo_Female, "thumnbnail/thumnbs_bodytattoo_f", this.smallRect.bodytattoo);
			EditMode.SetupThumbs<PrefabData>(ref this.thumnbs_faceDetail, CustomDataManager.FaceDetails_Female, "thumnbnail/thumnbs_facedetail_f", this.smallRect.faceSkin);
			EditMode.SetupThumbs<PrefabData>(ref this.thumnbs_bodyDetail, CustomDataManager.BodyDetails_Female, "thumnbnail/thumnbs_bodydetail_f", this.smallRect.bodySkin);
			EditMode.SetupThumbs<PrefabData>(ref this.thumnbs_eyelash, CustomDataManager.Eyelash, "thumnbnail/thumnbs_eyelash", this.smallRect.eyelash);
			EditMode.SetupThumbs<PrefabData>(ref this.thumnbs_eyehighlight, CustomDataManager.Eyehighlight, "thumnbnail/thumnbs_eyehighlight", this.smallRect.eyehighlight);
			EditMode.SetupThumbs<PrefabData>(ref this.thumnbs_eyebrow, CustomDataManager.Eyebrow_Female, "thumnbnail/thumnbs_eyebrow", this.smallRect.eyebrow);
			EditMode.SetupThumbs<PrefabData>(ref this.thumnbs_eye, CustomDataManager.Eye_Female, "thumnbnail/thumnbs_eye", this.smallRect.eye);
			EditMode.SetupThumbs_Tex<CombineTextureData>(ref this.thumnbs_mole, CustomDataManager.Mole, "thumnbnail/thumnbs_mole", this.smallRect.mole);
			EditMode.SetupThumbs_Tex<CombineTextureData>(ref this.thumnbs_eyeshadow, CustomDataManager.EyeShadow, "thumnbnail/thumnbs_eyeshadow", this.smallRect.eyeshadow);
			EditMode.SetupThumbs_Tex<CombineTextureData>(ref this.thumnbs_cheek, CustomDataManager.Cheek, "thumnbnail/thumnbs_cheek", this.smallRect.cheek);
			EditMode.SetupThumbs_Tex<CombineTextureData>(ref this.thumnbs_lip, CustomDataManager.Lip, "thumnbnail/thumnbs_lip", this.smallRect.lip);
			EditMode.SetupThumbs_Tex<CombineTextureData>(ref this.thumnbs_faceTattoo, CustomDataManager.FaceTattoo_Female, "thumnbnail/thumnbs_faceTattoo", this.smallRect.faceTattoo);
			EditMode.SetupThumbs<PrefabData>(ref this.thumnbs_nip, CustomDataManager.Nip, "thumnbnail/thumnbs_nip", this.smallRect.nip);
			EditMode.SetupThumbs<UnderhairData>(ref this.thumnbs_underhair, CustomDataManager.Underhair, "thumnbnail/thumnbs_underhair", this.smallRect.underhair);
		}
		else
		{
			EditMode.SetupThumbs<PrefabData>(ref this.thumnbs_faceSkin, CustomDataManager.FaceSkins_Male, "thumnbnail/thumnbs_faceskin_m", this.smallRect.faceSkin);
			EditMode.SetupThumbs<PrefabData>(ref this.thumnbs_bodySkin, CustomDataManager.BodySkins_Male, "thumnbnail/thumnbs_bodyskin_m", this.smallRect.bodySkin);
			EditMode.SetupThumbs_Tex<CombineTextureData>(ref this.thumnbs_bodyTattoo, CustomDataManager.BodyTattoo_Male, "thumnbnail/thumnbs_bodytattoo_m", this.smallRect.bodytattoo);
			EditMode.SetupThumbs<PrefabData>(ref this.thumnbs_faceDetail, CustomDataManager.FaceDetails_Male, "thumnbnail/thumnbs_facedetail_m", this.smallRect.faceSkin);
			EditMode.SetupThumbs<PrefabData>(ref this.thumnbs_bodyDetail, CustomDataManager.BodyDetails_Male, "thumnbnail/thumnbs_bodydetail_m", this.smallRect.bodySkin);
			EditMode.SetupThumbs<PrefabData>(ref this.thumnbs_eyebrow, CustomDataManager.Eyebrow_Male, "thumnbnail/thumnbs_eyebrow_m", this.smallRect.eyebrow);
			EditMode.SetupThumbs<PrefabData>(ref this.thumnbs_eye, CustomDataManager.Eye_Male, "thumnbnail/thumnbs_eye_m", this.smallRect.eye);
			EditMode.SetupThumbs_Tex<CombineTextureData>(ref this.thumnbs_faceTattoo, CustomDataManager.FaceTattoo_Male, "thumnbnail/thumnbs_faceTattoo_m", this.smallRect.faceTattoo);
			EditMode.SetupThumbs<PrefabData>(ref this.thumnbs_beard, CustomDataManager.Beard, "thumnbnail/thumnbs_beard", this.smallRect.beard);
		}
		string[] array = new string[]
		{
			"thumnbnail/thumbnail_accehead",
			"thumnbnail/thumbnail_acceear",
			"thumnbnail/thumbnail_accemegane",
			"thumnbnail/thumbnail_acceface",
			"thumnbnail/thumbnail_acceneck",
			"thumnbnail/thumbnail_acceshoulder",
			"thumnbnail/thumbnail_accebreast",
			"thumnbnail/thumbnail_accewaist",
			"thumnbnail/thumbnail_acceback",
			"thumnbnail/thumbnail_accearm",
			"thumnbnail/thumbnail_accehand",
			"thumnbnail/thumbnail_acceleg"
		};
		for (int i = 0; i < 12; i++)
		{
			this.thumnbs_acce[i] = new List<CustomSelectSet>();
			ACCESSORY_TYPE type = (ACCESSORY_TYPE)i;
			EditMode.SetupThumbs_Acce<AccessoryData>(ref this.thumnbs_acce[i], CustomDataManager.GetAccessoryDictionary(type), array[i], string.Empty, this.smallRect.acce[i]);
		}
	}

	// Token: 0x06000D0A RID: 3338 RVA: 0x0004EB9C File Offset: 0x0004CD9C
	private static void SetupThumbs<_T>(ref List<CustomSelectSet> list, Dictionary<int, _T> dictionary, string searchPath, string ignore, Rect smallRect) where _T : PrefabData
	{
		string fileName = Path.GetFileName(searchPath);
		string[] files = Directory.GetFiles("abdata/thumnbnail", fileName + "*", SearchOption.TopDirectoryOnly);
		foreach (string text in files)
		{
			if (!Path.HasExtension(text))
			{
				if (ignore.Length <= 0 || !Regex.IsMatch(text, ignore, RegexOptions.IgnoreCase))
				{
					string assetBundle = "thumnbnail/" + Path.GetFileNameWithoutExtension(text);
					EditMode.SetupThumbs<_T>(ref list, dictionary, assetBundle, smallRect);
				}
			}
		}
	}

	// Token: 0x06000D0B RID: 3339 RVA: 0x0004EC34 File Offset: 0x0004CE34
	private static void SetupThumbs<_T>(ref List<CustomSelectSet> list, Dictionary<int, _T> dictionary, string assetBundle, Rect smallRect) where _T : PrefabData
	{
		AssetBundleController assetBundleController = new AssetBundleController();
		assetBundleController.OpenFromFile(GlobalData.assetBundlePath, assetBundle);
		List<_T> list2 = new List<_T>();
		foreach (KeyValuePair<int, _T> keyValuePair in dictionary)
		{
			list2.Add(keyValuePair.Value);
		}
		list2.Sort((_T a, _T b) => a.order - b.order);
		foreach (_T t in list2)
		{
			list.Add(EditMode.CreateData(t, smallRect, assetBundleController));
		}
		assetBundleController.Close(false);
	}

	// Token: 0x06000D0C RID: 3340 RVA: 0x0004ED1C File Offset: 0x0004CF1C
	private static void SetupThumbs_HairBack(ref List<CustomSelectSet> list, Dictionary<int, BackHairData> dictionary, string searchPath, string ignore, Rect smallRect, bool isSet)
	{
		string fileName = Path.GetFileName(searchPath);
		string[] files = Directory.GetFiles("abdata/thumnbnail", fileName + "*", SearchOption.TopDirectoryOnly);
		foreach (string text in files)
		{
			if (!Path.HasExtension(text))
			{
				if (ignore.Length <= 0 || !Regex.IsMatch(text, ignore, RegexOptions.IgnoreCase))
				{
					string assetBundle = "thumnbnail/" + Path.GetFileNameWithoutExtension(text);
					EditMode.SetupThumbs_HairBack(ref list, dictionary, assetBundle, smallRect, isSet);
				}
			}
		}
	}

	// Token: 0x06000D0D RID: 3341 RVA: 0x0004EDB4 File Offset: 0x0004CFB4
	private static void SetupThumbs_HairBack(ref List<CustomSelectSet> list, Dictionary<int, BackHairData> dictionary, string assetBundle, Rect smallRect, bool isSet)
	{
		AssetBundleController assetBundleController = new AssetBundleController();
		assetBundleController.OpenFromFile(GlobalData.assetBundlePath, assetBundle);
		foreach (KeyValuePair<int, BackHairData> keyValuePair in dictionary)
		{
			if (keyValuePair.Value.isSet == isSet)
			{
				list.Add(EditMode.CreateData(keyValuePair.Value, smallRect, assetBundleController));
			}
		}
		assetBundleController.Close(false);
	}

	// Token: 0x06000D0E RID: 3342 RVA: 0x0004EE48 File Offset: 0x0004D048
	private static void SetupThumbs_Tex<_T>(ref List<CustomSelectSet> list, Dictionary<int, _T> dictionary, string searchPath, string ignore, Rect smallRect) where _T : CombineTextureData
	{
		string fileName = Path.GetFileName(searchPath);
		string[] files = Directory.GetFiles("abdata/thumnbnail", fileName + "*", SearchOption.TopDirectoryOnly);
		foreach (string text in files)
		{
			if (!Path.HasExtension(text))
			{
				if (ignore.Length <= 0 || !Regex.IsMatch(text, ignore, RegexOptions.IgnoreCase))
				{
					string assetBundle = "thumnbnail/" + Path.GetFileNameWithoutExtension(text);
					EditMode.SetupThumbs_Tex<_T>(ref list, dictionary, assetBundle, smallRect);
				}
			}
		}
	}

	// Token: 0x06000D0F RID: 3343 RVA: 0x0004EEE0 File Offset: 0x0004D0E0
	private static void SetupThumbs_Tex<_T>(ref List<CustomSelectSet> list, Dictionary<int, _T> dictionary, string assetBundle, Rect smallRect) where _T : CombineTextureData
	{
		AssetBundleController assetBundleController = new AssetBundleController();
		assetBundleController.OpenFromFile(GlobalData.assetBundlePath, assetBundle);
		foreach (KeyValuePair<int, _T> keyValuePair in dictionary)
		{
			list.Add(EditMode.CreateData(keyValuePair.Value, smallRect, assetBundleController));
		}
		assetBundleController.Close(false);
	}

	// Token: 0x06000D10 RID: 3344 RVA: 0x0004EF64 File Offset: 0x0004D164
	private static void SetupThumbs_Head<_T>(ref List<CustomSelectSet> list, Dictionary<int, _T> dictionary, string searchPath, string ignore, Rect smallRect) where _T : HeadData
	{
		string fileName = Path.GetFileName(searchPath);
		string[] files = Directory.GetFiles("abdata/thumnbnail", fileName + "*", SearchOption.TopDirectoryOnly);
		foreach (string text in files)
		{
			if (!Path.HasExtension(text))
			{
				if (ignore.Length <= 0 || !Regex.IsMatch(text, ignore, RegexOptions.IgnoreCase))
				{
					string assetBundle = "thumnbnail/" + Path.GetFileNameWithoutExtension(text);
					EditMode.SetupThumbs_Head<_T>(ref list, dictionary, assetBundle, smallRect);
				}
			}
		}
	}

	// Token: 0x06000D11 RID: 3345 RVA: 0x0004EFFC File Offset: 0x0004D1FC
	private static void SetupThumbs_Head<_T>(ref List<CustomSelectSet> list, Dictionary<int, _T> dictionary, string assetBundle, Rect smallRect) where _T : HeadData
	{
		AssetBundleController assetBundleController = new AssetBundleController();
		assetBundleController.OpenFromFile(GlobalData.assetBundlePath, assetBundle);
		foreach (KeyValuePair<int, _T> keyValuePair in dictionary)
		{
			list.Add(EditMode.CreateData(keyValuePair.Value, smallRect, assetBundleController));
		}
		assetBundleController.Close(false);
	}

	// Token: 0x06000D12 RID: 3346 RVA: 0x0004F080 File Offset: 0x0004D280
	private static void SetupThumbs_Acce<_T>(ref List<CustomSelectSet> list, Dictionary<int, _T> dictionary, string searchPath, string ignore, Rect smallRect) where _T : AccessoryData
	{
		string fileName = Path.GetFileName(searchPath);
		string[] files = Directory.GetFiles("abdata/thumnbnail", fileName + "*", SearchOption.TopDirectoryOnly);
		foreach (string text in files)
		{
			if (!Path.HasExtension(text))
			{
				if (ignore.Length <= 0 || !Regex.IsMatch(text, ignore, RegexOptions.IgnoreCase))
				{
					string assetBundleName = "thumnbnail/" + Path.GetFileNameWithoutExtension(text);
					AssetBundleController assetBundleController = new AssetBundleController();
					assetBundleController.OpenFromFile(GlobalData.assetBundlePath, assetBundleName);
					foreach (KeyValuePair<int, _T> keyValuePair in dictionary)
					{
						list.Add(EditMode.CreateData(keyValuePair.Value, smallRect, assetBundleController));
					}
					assetBundleController.Close(false);
				}
			}
		}
	}

	// Token: 0x06000D13 RID: 3347 RVA: 0x0004F18C File Offset: 0x0004D38C
	private static CustomSelectSet CreateData(PrefabData item, Rect smallRect, AssetBundleController abc)
	{
		Vector2 vector = new Vector2(256f, 256f);
		Texture2D texture = abc.LoadAsset<Texture2D>(item.prefab);
		Sprite thumbnail_L = Sprite.Create(texture, new Rect(Vector2.zero, vector), vector * 0.5f, 100f, 0U, SpriteMeshType.FullRect);
		Sprite thumbnail_S = Sprite.Create(texture, smallRect, smallRect.size * 0.5f, 100f, 0U, SpriteMeshType.FullRect);
		return new CustomSelectSet(item.id, item.name_LineFeed, thumbnail_S, thumbnail_L, item.isNew);
	}

	// Token: 0x06000D14 RID: 3348 RVA: 0x0004F214 File Offset: 0x0004D414
	private static CustomSelectSet CreateData(CombineTextureData item, Rect smallRect, AssetBundleController abc)
	{
		Vector2 vector = new Vector2(256f, 256f);
		Texture2D texture = abc.LoadAsset<Texture2D>(item.textureName);
		Sprite thumbnail_L = Sprite.Create(texture, new Rect(Vector2.zero, vector), vector * 0.5f, 100f, 0U, SpriteMeshType.FullRect);
		Sprite thumbnail_S = Sprite.Create(texture, smallRect, smallRect.size * 0.5f, 100f, 0U, SpriteMeshType.FullRect);
		return new CustomSelectSet(item.id, item.name_LineFeed, thumbnail_S, thumbnail_L, item.isNew);
	}

	// Token: 0x06000D15 RID: 3349 RVA: 0x0004F29C File Offset: 0x0004D49C
	private static CustomSelectSet CreateData(HeadData item, Rect smallRect, AssetBundleController abc)
	{
		Vector2 vector = new Vector2(256f, 256f);
		Texture2D texture = abc.LoadAsset<Texture2D>(item.path);
		Sprite thumbnail_L = Sprite.Create(texture, new Rect(Vector2.zero, vector), vector * 0.5f, 100f, 0U, SpriteMeshType.FullRect);
		Sprite thumbnail_S = Sprite.Create(texture, smallRect, smallRect.size * 0.5f, 100f, 0U, SpriteMeshType.FullRect);
		return new CustomSelectSet(item.id, item.name_LineFeed, thumbnail_S, thumbnail_L, item.isNew);
	}

	// Token: 0x06000D16 RID: 3350 RVA: 0x0004F324 File Offset: 0x0004D524
	private static CustomSelectSet CreateData(AccessoryData item, Rect smallRect, AssetBundleController abc)
	{
		Vector2 vector = new Vector2(256f, 256f);
		string prefab_F = item.prefab_F;
		Texture2D texture = abc.LoadAsset<Texture2D>(prefab_F);
		Sprite thumbnail_L = Sprite.Create(texture, new Rect(Vector2.zero, vector), vector * 0.5f, 100f, 0U, SpriteMeshType.FullRect);
		Sprite thumbnail_S = Sprite.Create(texture, smallRect, smallRect.size * 0.5f, 100f, 0U, SpriteMeshType.FullRect);
		return new CustomSelectSet(item.id, item.name_LineFeed, thumbnail_S, thumbnail_L, item.isNew);
	}

	// Token: 0x06000D17 RID: 3351 RVA: 0x0004F3B0 File Offset: 0x0004D5B0
	public Button CreateButton(GameObject parent, string title, UnityAction onClick)
	{
		Button button = UnityEngine.Object.Instantiate<Button>(this.buttonOriginal);
		button.gameObject.SetActive(true);
		button.transform.SetParent(parent.transform, false);
		button.onClick.AddListener(onClick);
		button.gameObject.GetComponentInChildren<Text>().text = title;
		return button;
	}

	// Token: 0x06000D18 RID: 3352 RVA: 0x0004F408 File Offset: 0x0004D608
	public MoveableThumbnailSelectUI CreateSelect(GameObject parent)
	{
		MoveableThumbnailSelectUI moveableThumbnailSelectUI = UnityEngine.Object.Instantiate<MoveableThumbnailSelectUI>(this.selectOriginal);
		moveableThumbnailSelectUI.gameObject.SetActive(true);
		moveableThumbnailSelectUI.transform.SetParent(parent.transform, false);
		moveableThumbnailSelectUI.Close();
		return moveableThumbnailSelectUI;
	}

	// Token: 0x06000D19 RID: 3353 RVA: 0x0004F448 File Offset: 0x0004D648
	public ItemChangeToggle CreateItemToggle(GameObject parent)
	{
		ItemChangeToggle itemChangeToggle = UnityEngine.Object.Instantiate<ItemChangeToggle>(this.itemChangeToggleOriginal);
		itemChangeToggle.gameObject.SetActive(true);
		itemChangeToggle.transform.SetParent(parent.transform, false);
		return itemChangeToggle;
	}

	// Token: 0x06000D1A RID: 3354 RVA: 0x0004F480 File Offset: 0x0004D680
	public PresetListToggle CreatePresetListToggle(GameObject parent)
	{
		PresetListToggle presetListToggle = UnityEngine.Object.Instantiate<PresetListToggle>(this.presetListToggleOriginal);
		presetListToggle.gameObject.SetActive(true);
		presetListToggle.transform.SetParent(parent.transform, false);
		return presetListToggle;
	}

	// Token: 0x06000D1B RID: 3355 RVA: 0x0004F4B8 File Offset: 0x0004D6B8
	public ItemSelectUISets CreateItemSelectUISets(GameObject parent, string title, List<CustomSelectSet> setDatas, UnityAction<CustomSelectSet> act)
	{
		return new ItemSelectUISets(this, parent, this.itemSelectUI, title, setDatas, act);
	}

	// Token: 0x06000D1C RID: 3356 RVA: 0x0004F4CC File Offset: 0x0004D6CC
	public PresetSelectUISets CreatePresetSelectUISets(GameObject parent, string title, List<CustomSelectSet> setDatas, UnityAction<CustomSelectSet> act)
	{
		return new PresetSelectUISets(this, parent, this.itemSelectUI, title, setDatas, act);
	}

	// Token: 0x06000D1D RID: 3357 RVA: 0x0004F4E0 File Offset: 0x0004D6E0
	public DropDownUI CreateDropDownUI(GameObject parent, string title, List<Dropdown.OptionData> options, UnityAction<int> act)
	{
		DropDownUI dropDownUI = UnityEngine.Object.Instantiate<DropDownUI>(this.dropdownUIOriginal);
		dropDownUI.gameObject.SetActive(true);
		dropDownUI.transform.SetParent(parent.transform, false);
		dropDownUI.SetTitle(title);
		dropDownUI.SetList(options);
		dropDownUI.AddOnValueChange(act);
		return dropDownUI;
	}

	// Token: 0x06000D1E RID: 3358 RVA: 0x0004F530 File Offset: 0x0004D730
	public ColorChangeButton CreateColorChangeButton(GameObject parent, string title, Color color, bool hasAlpha, Action<Color> act)
	{
		ColorChangeButton colorChangeButton = UnityEngine.Object.Instantiate<ColorChangeButton>(this.colorChangeButtonOriginal);
		colorChangeButton.colorUI = this.colorUI;
		colorChangeButton.gameObject.SetActive(true);
		colorChangeButton.transform.SetParent(parent.transform, false);
		colorChangeButton.Setup(title, color, hasAlpha, act);
		return colorChangeButton;
	}

	// Token: 0x06000D1F RID: 3359 RVA: 0x0004F580 File Offset: 0x0004D780
	public SwitchUI CreateSwitchUI(GameObject parent, string title, bool flag, UnityAction<bool> act)
	{
		SwitchUI switchUI = UnityEngine.Object.Instantiate<SwitchUI>(this.switchUIOriginal);
		switchUI.gameObject.SetActive(true);
		switchUI.transform.SetParent(parent.transform, false);
		switchUI.Setup(title, flag, act);
		return switchUI;
	}

	// Token: 0x06000D20 RID: 3360 RVA: 0x0004F5C4 File Offset: 0x0004D7C4
	public InputSliderUI CreateInputSliderUI(GameObject parent, string title, float min, float max, bool hasDef, float defVal, UnityAction<float> onChange)
	{
		InputSliderUI inputSliderUI = UnityEngine.Object.Instantiate<InputSliderUI>(this.inputSliderUIOriginal);
		inputSliderUI.gameObject.SetActive(true);
		inputSliderUI.transform.SetParent(parent.transform, false);
		inputSliderUI.Setup(title, min, max, hasDef, defVal, onChange);
		return inputSliderUI;
	}

	// Token: 0x06000D21 RID: 3361 RVA: 0x0004F60C File Offset: 0x0004D80C
	public RectTransform CreateSpace(GameObject parent)
	{
		RectTransform rectTransform = UnityEngine.Object.Instantiate<RectTransform>(this.spaceOriginal);
		rectTransform.gameObject.SetActive(true);
		rectTransform.transform.SetParent(parent.transform, false);
		return rectTransform;
	}

	// Token: 0x06000D22 RID: 3362 RVA: 0x0004F644 File Offset: 0x0004D844
	public Text CreateLabel(GameObject parent, string text)
	{
		Text text2 = UnityEngine.Object.Instantiate<Text>(this.labelOriginal);
		text2.gameObject.SetActive(true);
		text2.transform.SetParent(parent.transform, false);
		text2.GetComponentInChildren<Text>().text = text;
		return text2;
	}

	// Token: 0x06000D23 RID: 3363 RVA: 0x0004F688 File Offset: 0x0004D888
	public MoveableGuideDriveUI ShowMoveableGuideDriveUI(string title, Vector3 pos, Vector3 eul, Vector3 scl, UnityAction<MoveableUI.STATE> onChangeState, UnityAction<Vector3, Vector3, Vector3> onMove)
	{
		this.guideDriveUI.gameObject.SetActive(true);
		this.guideDriveUI.Setup(title, pos, eul, scl, onChangeState, onMove);
		this.guideDriveUI.Open();
		return this.guideDriveUI;
	}

	// Token: 0x06000D24 RID: 3364 RVA: 0x0004F6C0 File Offset: 0x0004D8C0
	public void HideMoveableGuideDriveUI(Transform target)
	{
		this.guideDriveUI.Close();
		this.guideDriveUI.gameObject.SetActive(false);
	}

	// Token: 0x06000D25 RID: 3365 RVA: 0x0004F6E0 File Offset: 0x0004D8E0
	public void HideMoveableGuideDriveUI_WithoutSE(Transform target)
	{
		this.guideDriveUI.gameObject.SetActive(false);
		this.guideDriveUI.Close();
	}

	// Token: 0x06000D26 RID: 3366 RVA: 0x0004F700 File Offset: 0x0004D900
	public void ChangeFaceType(int no)
	{
		this.human.customParam.head.headID = no;
		this.human.Apply();
	}

	// Token: 0x06000D27 RID: 3367 RVA: 0x0004F724 File Offset: 0x0004D924
	public void LoadedHuman()
	{
		this.face.LoadedHuman();
		this.body.LoadedHuman();
		this.wear.LoadedHuman();
		HWearAcceChangeUI hwearAcceChangeUI = UnityEngine.Object.FindObjectOfType<HWearAcceChangeUI>();
		if (hwearAcceChangeUI != null)
		{
			hwearAcceChangeUI.CheckShowUI();
		}
	}

	// Token: 0x06000D28 RID: 3368 RVA: 0x0004F76C File Offset: 0x0004D96C
	public void LoadedCoordinate()
	{
		this.wear.LoadedCoordinate();
		HWearAcceChangeUI hwearAcceChangeUI = UnityEngine.Object.FindObjectOfType<HWearAcceChangeUI>();
		if (hwearAcceChangeUI != null)
		{
			hwearAcceChangeUI.CheckShowUI();
		}
	}

	// Token: 0x06000D29 RID: 3369 RVA: 0x0004F79C File Offset: 0x0004D99C
	public void ChangedColor()
	{
		this.hair.ChangedColor();
		this.face.ChangedColor();
		this.body.ChangedColor();
	}

	// Token: 0x06000D2A RID: 3370 RVA: 0x0004F7C0 File Offset: 0x0004D9C0
	public void RecordCustomData()
	{
		CustomParameter customParameter;
		if (this.human.sex == SEX.FEMALE)
		{
			Female female = this.human as Female;
			customParameter = GlobalData.PlayData.GetHeroineCustomParam(female.HeroineID);
		}
		else
		{
			Male male = this.human as Male;
			customParameter = GlobalData.PlayData.GetMaleCustomParam(male.MaleID);
		}
		if (customParameter != null)
		{
			customParameter.Copy(this.human.customParam, -1);
		}
	}

	// Token: 0x06000D2B RID: 3371 RVA: 0x0004F838 File Offset: 0x0004DA38
	public void RevertCustomData()
	{
		CustomParameter customParameter;
		if (this.human.sex == SEX.FEMALE)
		{
			Female female = this.human as Female;
			customParameter = GlobalData.PlayData.GetHeroineCustomParam(female.HeroineID);
		}
		else
		{
			Male male = this.human as Male;
			customParameter = GlobalData.PlayData.GetMaleCustomParam(male.MaleID);
		}
		if (customParameter != null)
		{
			this.human.customParam.Copy(customParameter, -1);
		}
		this.human.Apply();
	}

	// Token: 0x06000D2C RID: 3372 RVA: 0x0004F8BC File Offset: 0x0004DABC
	public void ShowUI(bool show)
	{
		this.show = show;
		this.ui_canvas.enabled = (show && !this.GameCtrl.IsHideUI);
	}

	// Token: 0x04000D5D RID: 3421
	public string path_FemaleBody = "FemaleBody";

	// Token: 0x04000D5E RID: 3422
	public string path_MaleBody = "MaleBody";

	// Token: 0x04000D5F RID: 3423
	[SerializeField]
	private Canvas ui_canvas;

	// Token: 0x04000D60 RID: 3424
	[SerializeField]
	private FaceCustomEdit face;

	// Token: 0x04000D61 RID: 3425
	[SerializeField]
	private BodyCustomEdit body;

	// Token: 0x04000D62 RID: 3426
	[SerializeField]
	private HairCustomEdit hair;

	// Token: 0x04000D63 RID: 3427
	[SerializeField]
	private WearCustomEdit wear;

	// Token: 0x04000D64 RID: 3428
	[SerializeField]
	private AccessoryCustomEdit acce;

	// Token: 0x04000D65 RID: 3429
	[SerializeField]
	private DataCustomEdit data;

	// Token: 0x04000D66 RID: 3430
	[SerializeField]
	private ToggleButton[] toggles = new ToggleButton[6];

	// Token: 0x04000D67 RID: 3431
	[SerializeField]
	private GameObject[] tabMains = new GameObject[6];

	// Token: 0x04000D68 RID: 3432
	[SerializeField]
	private Button buttonOriginal;

	// Token: 0x04000D69 RID: 3433
	[SerializeField]
	private PresetListToggle presetListToggleOriginal;

	// Token: 0x04000D6A RID: 3434
	[SerializeField]
	private ItemChangeToggle itemChangeToggleOriginal;

	// Token: 0x04000D6B RID: 3435
	[SerializeField]
	private MoveableThumbnailSelectUI selectOriginal;

	// Token: 0x04000D6C RID: 3436
	[SerializeField]
	private DropDownUI dropdownUIOriginal;

	// Token: 0x04000D6D RID: 3437
	[SerializeField]
	private ColorChangeButton colorChangeButtonOriginal;

	// Token: 0x04000D6E RID: 3438
	[SerializeField]
	private SwitchUI switchUIOriginal;

	// Token: 0x04000D6F RID: 3439
	[SerializeField]
	private InputSliderUI inputSliderUIOriginal;

	// Token: 0x04000D70 RID: 3440
	[SerializeField]
	private RectTransform spaceOriginal;

	// Token: 0x04000D71 RID: 3441
	[SerializeField]
	private Text labelOriginal;

	// Token: 0x04000D72 RID: 3442
	[SerializeField]
	private MoveableGuideDriveUI guideDriveUI;

	// Token: 0x04000D73 RID: 3443
	[SerializeField]
	private CharaColorCopyHelper colorCopyHelper;

	// Token: 0x04000D74 RID: 3444
	private Human human;

	// Token: 0x04000D75 RID: 3445
	public List<CustomSelectSet> thumnbs_hair_set = new List<CustomSelectSet>();

	// Token: 0x04000D76 RID: 3446
	public List<CustomSelectSet> thumnbs_hair_back = new List<CustomSelectSet>();

	// Token: 0x04000D77 RID: 3447
	public List<CustomSelectSet> thumnbs_hair_side = new List<CustomSelectSet>();

	// Token: 0x04000D78 RID: 3448
	public List<CustomSelectSet> thumnbs_hair_front = new List<CustomSelectSet>();

	// Token: 0x04000D79 RID: 3449
	public List<CustomSelectSet> thumnbs_wear_tops = new List<CustomSelectSet>();

	// Token: 0x04000D7A RID: 3450
	public List<CustomSelectSet> thumnbs_wear_bottoms = new List<CustomSelectSet>();

	// Token: 0x04000D7B RID: 3451
	public List<CustomSelectSet> thumnbs_wear_bra = new List<CustomSelectSet>();

	// Token: 0x04000D7C RID: 3452
	public List<CustomSelectSet> thumnbs_wear_shorts = new List<CustomSelectSet>();

	// Token: 0x04000D7D RID: 3453
	public List<CustomSelectSet> thumnbs_wear_swimwear = new List<CustomSelectSet>();

	// Token: 0x04000D7E RID: 3454
	public List<CustomSelectSet> thumnbs_wear_swimtops = new List<CustomSelectSet>();

	// Token: 0x04000D7F RID: 3455
	public List<CustomSelectSet> thumnbs_wear_swimbottoms = new List<CustomSelectSet>();

	// Token: 0x04000D80 RID: 3456
	public List<CustomSelectSet> thumnbs_wear_glove = new List<CustomSelectSet>();

	// Token: 0x04000D81 RID: 3457
	public List<CustomSelectSet> thumnbs_wear_panst = new List<CustomSelectSet>();

	// Token: 0x04000D82 RID: 3458
	public List<CustomSelectSet> thumnbs_wear_socks = new List<CustomSelectSet>();

	// Token: 0x04000D83 RID: 3459
	public List<CustomSelectSet> thumnbs_wear_shoes = new List<CustomSelectSet>();

	// Token: 0x04000D84 RID: 3460
	public List<CustomSelectSet> thumnbs_eyebrow = new List<CustomSelectSet>();

	// Token: 0x04000D85 RID: 3461
	public List<CustomSelectSet> thumnbs_eyelash = new List<CustomSelectSet>();

	// Token: 0x04000D86 RID: 3462
	public List<CustomSelectSet> thumnbs_eye = new List<CustomSelectSet>();

	// Token: 0x04000D87 RID: 3463
	public List<CustomSelectSet> thumnbs_eyehighlight = new List<CustomSelectSet>();

	// Token: 0x04000D88 RID: 3464
	public List<CustomSelectSet> thumnbs_nip = new List<CustomSelectSet>();

	// Token: 0x04000D89 RID: 3465
	public List<CustomSelectSet> thumnbs_underhair = new List<CustomSelectSet>();

	// Token: 0x04000D8A RID: 3466
	public List<CustomSelectSet> thumnbs_sunburn = new List<CustomSelectSet>();

	// Token: 0x04000D8B RID: 3467
	public List<CustomSelectSet> thumnbs_bodyTattoo = new List<CustomSelectSet>();

	// Token: 0x04000D8C RID: 3468
	public List<CustomSelectSet> thumnbs_faceType = new List<CustomSelectSet>();

	// Token: 0x04000D8D RID: 3469
	public List<CustomSelectSet> thumnbs_faceSkin = new List<CustomSelectSet>();

	// Token: 0x04000D8E RID: 3470
	public List<CustomSelectSet> thumnbs_faceDetail = new List<CustomSelectSet>();

	// Token: 0x04000D8F RID: 3471
	public List<CustomSelectSet> thumnbs_bodySkin = new List<CustomSelectSet>();

	// Token: 0x04000D90 RID: 3472
	public List<CustomSelectSet> thumnbs_bodyDetail = new List<CustomSelectSet>();

	// Token: 0x04000D91 RID: 3473
	public List<CustomSelectSet> thumnbs_mole = new List<CustomSelectSet>();

	// Token: 0x04000D92 RID: 3474
	public List<CustomSelectSet> thumnbs_eyeshadow = new List<CustomSelectSet>();

	// Token: 0x04000D93 RID: 3475
	public List<CustomSelectSet> thumnbs_cheek = new List<CustomSelectSet>();

	// Token: 0x04000D94 RID: 3476
	public List<CustomSelectSet> thumnbs_lip = new List<CustomSelectSet>();

	// Token: 0x04000D95 RID: 3477
	public List<CustomSelectSet> thumnbs_faceTattoo = new List<CustomSelectSet>();

	// Token: 0x04000D96 RID: 3478
	public List<CustomSelectSet> thumnbs_beard = new List<CustomSelectSet>();

	// Token: 0x04000D97 RID: 3479
	public List<CustomSelectSet>[] thumnbs_acce = new List<CustomSelectSet>[12];

	// Token: 0x04000D98 RID: 3480
	private SmallThumnbnailRects smallRect = new SmallThumnbnailRects();

	// Token: 0x04000D99 RID: 3481
	[SerializeField]
	private CoordinateCapture coordinateCapture;

	// Token: 0x04000D9A RID: 3482
	[SerializeField]
	private Canvas backCardFrameCanvas;

	// Token: 0x04000D9B RID: 3483
	[SerializeField]
	private Canvas frontCardFrameCanvas;

	// Token: 0x04000D9C RID: 3484
	public Transform moveableRoot;

	// Token: 0x04000D9D RID: 3485
	public MoveableColorCustomUI colorUI;

	// Token: 0x04000D9E RID: 3486
	[SerializeField]
	private MoveableUI[] moveableUIs;

	// Token: 0x04000D9F RID: 3487
	[SerializeField]
	private MoveableThumbnailSelectUI itemSelectUI;

	// Token: 0x04000DA0 RID: 3488
	private EditMode.TAB nowTab = EditMode.TAB.NONE;

	// Token: 0x04000DA1 RID: 3489
	private GameControl gameCtrl;

	// Token: 0x04000DA2 RID: 3490
	private bool show = true;

	// Token: 0x020001ED RID: 493
	private enum TAB
	{
		// Token: 0x04000DA4 RID: 3492
		NONE = -1,
		// Token: 0x04000DA5 RID: 3493
		HAIR,
		// Token: 0x04000DA6 RID: 3494
		FACE,
		// Token: 0x04000DA7 RID: 3495
		BODY,
		// Token: 0x04000DA8 RID: 3496
		WEAR,
		// Token: 0x04000DA9 RID: 3497
		ACCE,
		// Token: 0x04000DAA RID: 3498
		DATA,
		// Token: 0x04000DAB RID: 3499
		NUM
	}
}
